import os

def setLotteryDir():
    envfile = os.environ.get('ENVFILE')
    with open(envfile + "/Lottery.conf","r") as file:
        for line in file:
            envarray = line.strip().split("=")
            if len(envarray) == 2:
                os.environ[str(envarray[0])] = str(envarray[1])
            else:
                print(str(envarray) + "配置异常，请重配。")
            file.close

def getFileDir():
    lotteryFiledir  = str(os.environ.get("filedir"))
    # print("lotteryFiledir:" + str(lotteryFiledir))
    return lotteryFiledir

def getFileName(args):
    lotteryFileName  = str(os.environ.get(str(args)))
    # print("lotteryFileName:" + str(lotteryFileName))
    return lotteryFileName




if __name__ == '__main__':
    setLotteryDir()
    fileDir = getFileDir()
    print(str(fileDir))


